<%@ page import="com.apexedu.identity.IdConstants" %>
<%@ page import="com.apexedu.identity.entity.TSysMenu" %>
<%@ page import="java.util.List" %>
<%@ page import="com.apexedu.identity.entity.TSysUser" %>
<%@ page import="com.apexedu.portal.util.umail.UMailUtil" %>
<%@ page import="com.apexedu.framework.util.DBUtil" %>
<%@ page import="com.apexedu.util.StringUtil" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%
    List<TSysMenu> mrfw = (List<TSysMenu>) request.getAttribute("mrfw");
    List<TSysMenu> dyfw = (List<TSysMenu>) request.getAttribute("dyfw");
    String type = (String) request.getAttribute("type");
    TSysUser user = (TSysUser) request.getSession().getAttribute(IdConstants.SESSION_USER);
    String screenname = user.getUserloginid();
    String passwd = screenname + "shgh_2015";
    String domain="shghxy.com";
    UMailUtil umail =new UMailUtil();
    String num="0";
    try{
        num=umail.getUnreadNumber(screenname+"@"+domain,passwd,domain);
    } catch (Exception e) {
        System.out.println(e.toString());
    }
    System.out.print("邮件数："+num);
    String ye="";
	String txl_n="690";
    try {
        ye= DBUtil.queryField("select to_char(ye) from v_onecard_ye where userid=?", screenname);
		txl_n=DBUtil.queryField("select to_char(max(id)) from usr_oa.tblog where category=20");
    }catch (Exception e) {
        System.out.println(e.toString());
    }
    System.out.print("一卡通余额："+ye);
%>
<html>
<head>
    <title>上海工会管理职业学院</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <link rel="shortcut icon" href="${basePath}/edu.ico" >
</head>
<body>

<div id="main">
    <jsp:include page="head.jsp"/>
    <script>
        $(function(){
            $(".titleLi:first").addClass("select");
        });
    </script>
    <div id="content">
        <div id="contentSub" class="contentSub${type}">
            <c:if test="${type=='ls'}">
                <div id="contentT">
                    <div id="contentTL">
                        <div id="news" class="lbxx">
                            <div class="lbxxtitle">
                                <ul>
                                    <li class="select" h="${basePath}/s/uc/mh/l/oa/2?t=">通知公告</li>
                                    <li h="${basePath}/s/uc/mh/l/oa/1?t=">新闻动态</li>
                                    <li>流程待办</li>
                                </ul>
                        <span class="turnSpan">
                            <label class="moreLabel"> 更多 </label>
				        </span>
                            </div>
                            <div class="lbxxcontent">
                                <ul class="select">
                                    <c:forEach items="${tzgg}" var="lbxx">
                                        <li onclick="window.open('${basePath}/s/uc/mh/no/oa/${lbxx.id}')">
                                        <span class="lbxxContentSpan" title="${lbxx.title}">${lbxx.title}
                                            <c:if test="${lbxx.isnew}">
                                                <img src="${basePath}/resources/images/new.gif"/>
                                            </c:if>
                                        </span>
                                    <span class="lbxxTimeSpan">
                                        <fmt:formatDate value="${lbxx.time}" pattern="yyyy-MM-dd"/>
                                    </span>
                                        </li>
                                    </c:forEach>
                                </ul>
                                <ul>
                                    <c:forEach items="${xydt}" var="lbxx">
                                        <li onclick="window.open('${basePath}/s/uc/mh/no/oa/${lbxx.id}')">
                                        <span class="lbxxContentSpan" title="${lbxx.title}">${lbxx.title}
                                            <c:if test="${lbxx.isnew}">
                                                <img src="${basePath}/resources/images/new.gif"/>
                                            </c:if>
                                        </span>
                                    <span class="lbxxTimeSpan"><fmt:formatDate value="${lbxx.time}"
                                                                               pattern="yyyy-MM-dd"/></span>
                                        </li>
                                    </c:forEach>
                                </ul>
                                <ul>
                                    <c:forEach items="${dbsy}" var="lbxx">
                                        <li onclick="window.open('${basePath}/s/uc/mh/f?q=${lbxx.depart}')">
                                            <span class="lbxxContentSpan" title="${lbxx.title}">${lbxx.title}</span>
                                    <span class="lbxxTimeSpan"><fmt:formatDate value="${lbxx.time}"
                                                                               pattern="yyyy-MM-dd"/></span>
                                        </li>
                                    </c:forEach>
                                </ul>
                            </div>
                        </div>

                        <div id="plan">
                            <div class="pla" >
                                <div id="yzap" class="pla-l" onclick="window.open('/s/uc/shgh/yzhy')"><span><i></i>一周安排</span></div>
                                <div class="pla-r">
                                    <span onclick="window.open('http://rep.shghxy.com:8792/s/report/OA_ZBB')"><i class="zb"></i>值班表</span>
                                    <span onclick="window.open('http://portal.shghxyedu.net:8108/s/uc/mh/no/oa/<%=txl_n%>')"><i class="tx"></i>通讯录</span>
                                </div>
                            </div>
                            <div class="plb">
                                <div class="plb-l"  id="jskb" o="jskbContent"><span><i></i>教师课表</span></div>
                                <div class="plb-r">
                                    <span onclick="window.open('http://rep.shghxy.com:8792/s/report/OA_XL')"><i></i>校历</span>
                                    <span onclick="window.open('http://rep.shghxy.com:8792/s/report/OA_ZXB')"><i class="zx"></i>作息表</span>
                                </div>
                            </div>
                            <div style="clear: both;"></div>
                        </div>
                    </div>
                    <div id="contentTR">
                        <div id="contentTRT">
                            <div id="weather" isUpdate="${isUpdate}">
                                <div class="dateW">${month}月${date}日</div>
                                <div class="dayW">${weekday}&nbsp;&nbsp;&nbsp;第${zc}教学周</div>
                                <div class="weatherW">
                                   <!--  <img src="${basePath}/resources/images/weather/${city.tp}.png" title="${city.weather}"> -->
								    <img src="${city.tp}" title="${city.weather}">
                                    <span class="tmax">${city.temp1}°</span>
                                    <span class="tmin">${city.temp2}°</span>
                                </div>
                            </div>
                            <div id="userinfo">
                                <div class="avatar"><img src="${basePath}/userinfo/${userid}"
                                                         onerror="this.src='${basePath}/userinfo/user_male_portrait.png'">
                                </div>
                                <div class="username">${username}</div>
                                <div class="remind">
                                    <% if(!"0".equals(num)){%>
                                <span onclick="window.open('${basePath}/s/uc/email')" style="cursor: pointer;" title="您有<%=num%>封未读邮件">
                                    <img src="${basePath}/resources/images/icon_mail.png" style="width: 26px;height: 20px;margin-right: 30px;">
                                    <label class="tx1"><%=num%></label>
                                </span>
                                    <%}else{%>
                                    <span onclick="window.open('${basePath}/s/uc/email')" >
                                        <img src="${basePath}/resources/images/icon_mail.png"  style="width: 26px;height: 20px;margin-right: 30px;">
                                    </span>
                                    <%}%>
                                    <c:choose>
                                        <c:when test="${dbsy.size()>0}">
                                       <span class="dbtxA" style="cursor: pointer;" title="您有${dbsy.size()}件流程代办">
                                            <img src="${basePath}/resources/images/icon_bell.png"
                                                 style="width: 20px;height: 20px;margin-right: 25px;">
                                            <span class="tx2">
                                                <div class="tx2c">${dbsy.size()}</div>
                                                <div class="tx2r"></div>
                                            </span>
                                        </span>
                                        </c:when>
                                        <c:otherwise>
                                        <span class="dbtxA">
                                            <img src="${basePath}/resources/images/icon_bell.png" style="width: 20px;height: 20px;margin-right: 25px;">
                                        </span>
                                        </c:otherwise>
                                    </c:choose>
                                <span style="cursor: pointer;" o="serverContentYkt">
                                    <img src="${basePath}/resources/images/icon_snil.png"
                                         style="width: 26px;height: 20px;">
                                </span>
                                </div>
                            </div>
                        </div>
                        <div id="roles" class="lbxx">
                            <div class="lbxxtitle">
                                <ul>
                                    <li h="${basePath}/s/uc/mh/l/oa/9?t=" class="select">规章制度</li>
                                    <li h="${basePath}/s/uc/mh/l/oa/6?t=">学习交流</li>
                                </ul>
                        <span class="turnSpan">
                            <label class="moreLabel"> 更多 </label>
				        </span>
                            </div>
                            <div class="lbxxcontent">
                                <ul class="select">
                                    <c:forEach items="${gzzd}" var="lbxx">
                                        <li onclick="window.open('${basePath}/s/uc/mh/no/oa/${lbxx.id}')">
                                        <span class="lbxxContentSpan" title="${lbxx.title}">${lbxx.title}
                                            <c:if test="${lbxx.isnew}">
                                                <img src="${basePath}/resources/images/new.gif"/>
                                            </c:if>
                                        </span>
                                    <span class="lbxxTimeSpan">
                                        <fmt:formatDate value="${lbxx.time}" pattern="yyyy-MM-dd"/>
                                    </span>
                                        </li>
                                    </c:forEach>
                                </ul>
                                <ul>
                                    <c:forEach items="${xxjl}" var="lbxx">
                                        <li onclick="window.open('${basePath}/s/uc/mh/no/oa/${lbxx.id}')">
                                        <span class="lbxxContentSpan" title="${lbxx.title}">${lbxx.title}
                                            <c:if test="${lbxx.isnew}">
                                                <img src="${basePath}/resources/images/new.gif"/>
                                            </c:if>
                                        </span>
                                    <span class="lbxxTimeSpan"><fmt:formatDate value="${lbxx.time}"
                                                                               pattern="yyyy-MM-dd"/></span>
                                        </li>
                                    </c:forEach>
                                </ul>
                            </div>
                        </div>
                    </div>
                </div>
            </c:if>
            <c:if test="${type=='xs' || type == 'ld'}">
                <div id="contentT">
                    <div id="contentTL">
                        <div id="news" class="lbxx">
                            <div class="lbxxtitle">
                                <ul>
                                    <c:if test="${type == 'xs'}">
                                        <li class="select" h="${basePath}/s/uc/mh/l/oa/1?t=">学院动态</li>
                                    </c:if>
                                    <c:if test="${type == 'ld'}">
                                        <li class="select" h="${basePath}/s/uc/mh/l/oa/2?t=">通知公告</li>
                                    </c:if>
                                </ul>
                                <span class="turnSpan">
                                    <label class="moreLabel"> 更多 </label>
                                </span>
                            </div>
                            <div class="lbxxcontent">
                                <ul class="select">
                                    <c:forEach items="${tzgg}" var="lbxx">
                                        <li onclick="window.open('${basePath}/s/uc/mh/no/oa/${lbxx.id}')">
                                        <span class="lbxxContentSpan" title="${lbxx.title}">${lbxx.title}
                                            <c:if test="${lbxx.isnew}">
                                                <img src="${basePath}/resources/images/new.gif"/>
                                            </c:if>
                                        </span>
                                        <span class="lbxxTimeSpan">
                                            <fmt:formatDate value="${lbxx.time}" pattern="yyyy-MM-dd"/>
                                        </span>
                                        </li>
                                    </c:forEach>
                                </ul>
                            </div>
                        </div>
                    </div>
                    <div id="contentTR">
                        <div id="contentTRT">
                            <div id="weather" isUpdate="${isUpdate}">
                                <div class="dateW">${month}月${date}日</div>
                                <div class="dayW">${weekday}&nbsp;&nbsp;&nbsp;第${zc}教学周</div>
                                <div class="weatherW">
                                    <img src="${basePath}/resources/images/weather/${city.tp}.png" title="${city.weather}">
                                    <span class="tmax">${city.temp1}°</span>
                                    <span class="tmin">${city.temp2}°</span>
                                </div>
                            </div>
                            <div id="userinfo">
                                <div style="margin: 30px auto 5px;"><img src="${basePath}/userinfo/${userid}"
                                                                         onerror="this.src='${basePath}/userinfo/user_male_portrait.png'" width="100" height="100">
                                </div>
                                <div class="username">${username}</div>
                                <div class="remind">
                                    <span style="cursor: pointer;" o="serverContentYkt">
                                        <img src="${basePath}/resources/images/icon_snil.png"
                                             style="width: 26px;height: 20px;">
                                    </span>
                                </div>
                            </div>
                        </div>
                        <div id="plan">
                            <c:if test="${type=='xs'}">
                                <div id="xskb" o="xskbContent">学生课表</div>
                            </c:if>
                            <c:if test="${type=='ld'}">
                                <div id="yzap" onclick="window.open('${basePath}/s/uc/shgh/yzhy')">一周安排</div>
                            </c:if>
                            <div style="clear: both;"></div>
                        </div>
                    </div>
                </div>
            </c:if>
            <div id="mrfw">
                <% for (int i = 0; i < mrfw.size(); i++) {
                    TSysMenu menu = mrfw.get(i);
                %>
                <div class="server bgbt" menuid="<%=menu.getMenuid()%>" <%if (i > 5) {%>style="display:none;"<%}%>>
                    <div class="servericon" style="background-color: #FFFFFF;"
                         onclick="window.open('<%=menu.getMenupath()%>')"><img
                            src="${basePath}/resources/images/icons/blue/<%=menu.getTb()%>"
                            onerror="this.src='${basePath}/resources/images/icons/icons-01.png'">
                    </div>
                    <div class="servertitle" title="<%=menu.getMenuname()%>" style="color:#FFFFFF;"> <!-- 服务ID -->
                        <a
                                href="<%=menu.getMenupath()%>" target="_blank" style="color:#59b6df;"><%=menu.getMenuname()%>
                        </a>
                    </div>
                </div>
                <%}%>
                <c:if test="${userid != 'admin'}">
                    <div class="server serverMore" style="width: 155px;" o="serverContent">
                        <div class="servericon" style="background: #0000FE;">
                            <img src="${basePath}/resources/images/icons/icons-05.png">
                        </div>
                        <div class="servertitle"
                             style="top: 70px; color: white; font-size: 16px; text-indent: -10px;"> <!-- 服务ID -->
                            <span> 更多 </span>
                        </div>
                    </div>
                </c:if>
                <c:if test="${userid == 'admin'}">
                    <div class="server serverAdd" style="width: 125px;margin-left: 20px;">
                        <div class="moreserver" o="serverContent">更多</div>
                        <div class="addserver" onclick="window.open('${basePath}/s/uc/se/i/${mrfwid}')">订阅</div>
                    </div>
                </c:if>
            </div>
            <div id="dyfw">
                <% for (int i = 0; i < dyfw.size(); i++) {
                    TSysMenu menu = dyfw.get(i);
                %>
                <div class="server" style="border:1px solid #00cc00;background-color:#fff; <%if (i > 5) {%> display:none;<%}%>"  menuid="<%=menu.getMenuid()%>"
                     name="<%=menu.getMenuname()%>"
                     pmenuid="000603298" pmenuname="<%=menu.getMenuname()%>" filetype="normal" >
                    <div class="servericon"
                         onclick="window.open('<%=menu.getMenupath()%>')"><img
                            src="${basePath}/resources/images/icons/green/<%=menu.getTb()%>"
                            onerror="this.src='${basePath}/resources/images/icons/green/icons-01.png'">
                    </div>
                    <div class="servertitle" title="<%=menu.getMenuname()%>"> <!-- 服务ID -->
                        <a
                                href="<%=menu.getMenupath()%>" target="_blank" style="color:#00cc00;"><%=menu.getMenuname()%>
                        </a></div>
                </div>
                <%}%>
                <div class="server serverAdd" style="width: 125px;margin-left: 20px;">
                    <div class="moreserver" o="serverContent">更多</div>
                    <div class="addserver" onclick="window.open('${basePath}/s/uc/se/i/${dyfwid}')">订阅</div>
                </div>
            </div>
            <!--教师课表start-->
            <div class="leftMore" id="jskbContent">
                <div class="titleDiv">
                    <span class="titleSpan">教师课表</span>
                    <span class="moreSpan" onclick="window.open('http://xgjw.shghxyedu.net:8790/OperateProcessor?operate=TJX_PKKFCX_M2&Table=TJX_PKKFCX&PageOnly=true')">more </span>
                </div>
                <div class="contentDiv">
                    <table>
                        <tr>
                            <td width="12%"></td>
                            <td width="12%">周一</td>
                            <td width="12%">周二</td>
                            <td width="12%">周三</td>
                            <td width="12%">周四</td>
                            <td width="12%">周五</td>
                            <td width="12%">周六</td>
                            <td width="12%">周日</td>
                        </tr>
                    </table>
                </div>
                <div class="hiddendiv">
                    <span class="closeSpan"> 关闭</span>
                </div>
                <div class="titleDescDiv"></div>
            </div>
            <!--教师课表start-->
            <div class="rightMore rightMore${type}" id="xskbContent">
                <div class="titleDiv">
                    <span class="titleSpan">学生课表</span>
                    <span class="moreSpan">more </span>
                </div>
                <div class="contentDiv">
                    <table>
                        <tr>
                            <td width="12%"></td>
                            <td width="12%">周一</td>
                            <td width="12%">周二</td>
                            <td width="12%">周三</td>
                            <td width="12%">周四</td>
                            <td width="12%">周五</td>
                            <td width="12%">周六</td>
                            <td width="12%">周日</td>
                        </tr>
                    </table>
                </div>
                <div class="hiddendiv">
                    <span class="closeSpan"> 关闭</span>
                </div>
                <div class="titleDescDiv"></div>
            </div>
            <!--教师课表end-->
            <div class="rightMore" id="serverContent">
                <div class="tRDiv">
                    <span class="tRSpan">已订阅服务</span>
                    <span class="cRSpan closeSpan">关闭</span>
                </div>
                <div class="cRDiv">
                </div>
            </div>
            <div class="rightMoreYkt" id="serverContentYkt">
                <div class="tRDiv">
                    <span class="tRSpan">一卡通信息</span>
                    <span class="cRSpan closeSpan">关闭</span>
                </div>
                <div class="cRDiv" style="text-align: left;margin-left: 10px;">
                    <%if(StringUtil.isNotBlank(ye)){
                    %>
                    <font color="aqua"><%=ye%></font>
                            <%
                    }
                    %>
                </div>
            </div>
        </div>
        <div id="contentBg"></div>
    </div>
    <jsp:include page="foot.jsp"/>
</div>
</body>
</html>
